<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <script>
      // const arr = [1, 2, 3, 4]

      // // let a = arr[0]
      // // let b = arr[1]
      // // let c = arr[2]
      // // let d = arr[3]

      //   let [a, b, c, d, e] = [1, 2, 3, 4]

      // console.log(a, b, c, d, e);

      //   let a = 1
      //   let b = 2

      //   ;[b, a] = [a, b]

      //   console.log(a, b)

      //练习
      //   const pc = ['海尔', '联想', '小米', '方正']

      //   let [hr, lx, mi, fz] = pc

      //   console.log(hr, lx, mi, fz)

      //   const fn = () => [100, 60]

      //   let [max, min] = fn()

      //   console.log(max, min)

      //   const arr = [1, 2, 3, 4]

      //   let [a, b, ...res] = arr

      //   console.log(a, b, res)

      //   const arr = [11, 22]

      //   let [a = 1, b = 2, c = 3] = arr

      //   console.log(a, b, c)

      //按需导入
      //   const arr = ['海尔', '联想', '小米', '方正']

      //   let [a, , c, d] = arr

      //   console.log(a, c, d)

      //   console.log(['海尔', null, '小米', '方正'][1])

      //   const arr = []

      //   arr[9] = 'harry'

      // console.log(arr)

      //   const obj = {
      //     uname: 'harry',
      //   }
    </script>
  </body>
</html>
